package com.topboya.linker.ui.adapter;

import android.content.Intent;
import android.graphics.Color;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.topboya.linker.R;
import com.topboya.linker.model.response.OrganizationResopnse;
import com.topboya.linker.ui.activity.SelectCustomerActivity;
import com.topboya.linker.ui.base.activity.BaseActivity;

import java.util.ArrayList;


public class CreateTaskAdapter extends BaseQuickAdapter<OrganizationResopnse.DocDetailInfoList, BaseViewHolder> {

    private static final String TAG = "CreateTaskAdapter:";
    private BaseActivity mBaseActivity;
    public CreateTaskAdapter(BaseActivity mBaseActivity,ArrayList<OrganizationResopnse.DocDetailInfoList> groupList) {

        super(R.layout.create_device_item, groupList);
        this.mBaseActivity =mBaseActivity;
    }

    @Override
    protected void convert(BaseViewHolder viewHolder,OrganizationResopnse.DocDetailInfoList groupList) {

         viewHolder.setText(R.id.tv_hasptial_level,groupList.getLevelName());
         viewHolder.setText(R.id.tv_hasptial_name,groupList.getOrgName());
         viewHolder.itemView.setOnClickListener(v -> {

//             viewHolder.setTextColor(R.id.tv_hasptial_name,Color.BLUE);
             Intent intent = new Intent(mContext,SelectCustomerActivity.class);
             intent.putExtra("DocDetailInfo",groupList);
             mContext.startActivity(intent);
         });
    }

}
